from django.shortcuts import render
from django.views.decorators.http import require_GET
from chat.tool import tool

# Create your views here.


@require_GET
def ask(request):
    qs = request.GET.get('qs')
    if qs == '' or qs is None:
        return
    else:
        data = tool.get_chatgpt(qs)
        return data